<template>
  <div class="cp">
    <h1>我是子组件1：我是曹植</h1>
  </div>
</template>

<script setup lang="ts">
import $bus from "../../bus";
import { onMounted } from "vue";
onMounted(() => {
  //第一个参数：为事件类型,第二个参数：即为事件回调
  $bus.on("car", (car) => {
    console.log(car);
  });
});
</script>

<style scoped>
.cp {
  width: 300px;
  height: 300px;
  background: skyblue;
}
</style>
